"use strict";
this.HashStorage = function () {};

this.HashStorage.prototype = (function () {
    var init, thread, save, load, wl, storage, location;

    init = function (webLayout) {
        var hash;
        wl = webLayout;
        storage = {};
        location = this.global.location;
        try {
            hash = location.hash;
            hash = hash.substring(0, 1) === '#' ? hash.substring(1) : hash;
            storage = webLayout.json(hash);
            if (storage === false) {
                storage = {};
            }
        } catch (e) {}
    };

    thread = function (webLayout) {};

    save = function (module, value) {
        storage[module] = value;
        location.hash = wl.encodeJSON(storage);
    };

    load = function (module) {
        return storage[module];
    };

    return {
        NAME: 'HashStorage',
        init: init,
        thread: thread,
        save: save,
        load: load
    };
}());

this.HashStorage.prototype.global = this;